﻿<UserControl x:Class="PresentationAid.Tabs.SettingsTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:elysium="http://schemas.codeplex.com/elysium"
             xmlns:params="http://schemas.codeplex.com/elysium/params"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">
    <UserControl.Resources>
        <!-- ReSharper disable Xaml.RedundantResource -->
        <Storyboard x:Key="SettingsSlideOpenAnimation">
        <!-- ReSharper restore Xaml.RedundantResource -->
            <DoubleAnimation Storyboard.TargetName="AdvancedSettingsGrid" Storyboard.TargetProperty="Height" From="0" To="240" Duration="0:0:0.2" BeginTime="0:0:0" />
        </Storyboard>

        <!-- ReSharper disable Xaml.RedundantResource -->
        <Storyboard x:Key="SettingsSlideCloseAnimation">
        <!-- ReSharper restore Xaml.RedundantResource -->
            <DoubleAnimation Storyboard.TargetName="AdvancedSettingsGrid" Storyboard.TargetProperty="Height" From="240" To="0" Duration="0:0:0.2" BeginTime="0:0:0" />
        </Storyboard>
    </UserControl.Resources>
    
    <ScrollViewer Margin="20,8,2,5" VerticalScrollBarVisibility="Auto">
        <Grid Margin="0,0,20,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="220" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
        
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
        
            <Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,0,0,5" Width="90" HorizontalAlignment="Left">
                <TextBlock FontSize="15" FontWeight="Light" Margin="5,5,5,5" Foreground="{DynamicResource LowlightBrush}">Application</TextBlock>
            </Border>

            <TextBlock Grid.Row="1" Grid.ColumnSpan="2" FontSize="12" Margin="20,3,0,10">Change and define application behaviour</TextBlock>

            <TextBlock Grid.Row="2" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">Language:</TextBlock>
            <ComboBox Name="LanguageSelector" Grid.Row="2" Grid.Column="1" SelectedIndex="{Binding Language}" HorizontalAlignment="Left" Width="200" Margin="0,0,0,10">
                <ComboBoxItem>Default</ComboBoxItem>
                <ComboBoxItem>English</ComboBoxItem>
                <ComboBoxItem>Slovenski</ComboBoxItem>
            </ComboBox>

            <TextBlock Grid.Row="3" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">Minimize to tray:</TextBlock>
            <elysium:ToggleSwitch Name="MinimizeToTrayToggle" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Width="100" OnHeader="On" OffHeader="Off" IsChecked="{Binding CanMinimizeToTray}" Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" />

            <TextBlock Grid.Row="4" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">Move to tray when ready:</TextBlock>
            <elysium:ToggleSwitch Name="StartInTrayToggle" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Left" Width="100" OnHeader="On" OffHeader="Off" IsEnabled="{Binding CanMinimizeToTray}" IsChecked="{Binding MoveToTray}" Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" />

            <Border BorderThickness="0,0,0,1" Grid.Row="5" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,8,0,5" Width="90" HorizontalAlignment="Left">
                <TextBlock FontSize="15" FontWeight="Light" Margin="5,5,5,5" Foreground="{DynamicResource LowlightBrush}">Notifications</TextBlock>
            </Border>

            <TextBlock Grid.Row="6" Grid.ColumnSpan="2" FontSize="12" Margin="20,3,0,10">Change notification settings during presentation</TextBlock>

            <TextBlock Grid.Row="7" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">Display popup notifications:</TextBlock>
            <elysium:ToggleSwitch Name="DisplayPopupToggle" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Left" Width="100" OnHeader="On" OffHeader="Off" IsChecked="{Binding DisplayPopupNotifications}" Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" />

            <TextBlock Grid.Row="8" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">Display overlay messages:</TextBlock>
            <elysium:ToggleSwitch Name="DisplayOverlayToggle"  Grid.Column="1" Grid.Row="8" HorizontalAlignment="Left" Width="100" OnHeader="On" OffHeader="Off" IsChecked="{Binding DisplayOverlay}" Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" />

            <TextBlock Grid.Row="9" VerticalAlignment="Center" FontSize="12" Margin="20,0,0,0">↳ Notify when no presenter visible:</TextBlock>
            <elysium:ToggleSwitch Name="NoPresenterOverlayToggle" Grid.Column="1" Grid.Row="9" HorizontalAlignment="Left" Width="100" OnHeader="On" OffHeader="Off" IsEnabled="{Binding DisplayOverlay}" IsChecked="{Binding NoPresenterOverlay}" Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" />

            <Border BorderThickness="0,0,0,1" Grid.Row="10" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,8,0,5" Width="90" HorizontalAlignment="Left">
                <TextBlock FontSize="15" FontWeight="Light" Margin="5,5,5,5" Foreground="{DynamicResource LowlightBrush}">Updates</TextBlock>
            </Border>

            <StackPanel Orientation="Horizontal" Grid.Row="11" Grid.ColumnSpan="2" Margin="20,3,0,10">
                <Viewbox Name="UpdateProgressViewbox" Width="16" Height="16" Stretch="Uniform" Margin="0,0,8,0" Visibility="Collapsed">
                    <elysium:ProgressRing Name="UpdateProgressRing" State="Busy" Width="24" Height="24" />
                </Viewbox>
                
                <Image Name="UpdateImage" Width="16" Height="16" Margin="0,0,8,0" Source="/PresentationAid;component/Resources/Images/Icons/warning2_16.png" />

                <TextBlock Name="UpdateDetailTextBlock" FontSize="12">You last checked for updates at: never</TextBlock>
            </StackPanel>

            <Button Grid.Row="12" Margin="20,0,0,0" Name="UpdateButton" Click="UpdateButtonClick">CHECK FOR UPDATES</Button>
            
            
            <CheckBox Name="AutoUpdateCheckbox" Grid.Row="13" Grid.ColumnSpan="2" IsChecked="{Binding AutoUpdate}" Content="Automatically check for updates when application starts" Margin="20,10,0,10" />

            <Grid Name="AdvancedSettingsGrid" Grid.Row="14" Grid.ColumnSpan="2" Height="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
            
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,8,0,5" Width="90" HorizontalAlignment="Left">
                    <TextBlock FontSize="15" FontWeight="Light" Margin="5,5,5,5" Foreground="{DynamicResource LowlightBrush}">Debugging</TextBlock>
                </Border>

                <TextBlock Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" FontSize="12" Margin="20,3,0,10">Debugging mode adds a new tab with detailed information</TextBlock>

                <CheckBox Name="DebugModeCheckbox" Grid.Row="2" Grid.ColumnSpan="2" IsChecked="{Binding DebugMode}" Content="Activate Debug mode" Margin="20,10,0,10" Unchecked="DebugModeCheckboxUnchecked" Checked="DebugModeCheckboxChecked" />

                <Border Grid.Row="3" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,8,0,5" Width="90" HorizontalAlignment="Left">
                    <TextBlock FontSize="15" FontWeight="Light" Margin="5,5,5,5" Foreground="{DynamicResource LowlightBrush}">Gestures</TextBlock>
                </Border>

                <TextBlock Grid.Row="4" Grid.ColumnSpan="2"  VerticalAlignment="Center" FontSize="12" Margin="20,3,0,10">Set which engine is used to execute gesture commands</TextBlock>

                <StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal">
                    <ComboBox Name="GestureEngineSelector" Margin="20,0,3,0" SelectedIndex="{Binding GestureEngineType}" Width="220" SelectionChanged="GestureEngineSelectorOnSelectionChanged">
                        <ComboBoxItem>PowerPoint</ComboBoxItem>
                        <ComboBoxItem>Extended Keystroke</ComboBoxItem>
                        <ComboBoxItem>Keystroke [Not recommended]</ComboBoxItem>
                    </ComboBox>
            
                    <Button Name="GestureEngineConfigureButton" Click="GestureEngineConfigureButtonClick">CONFIGURE</Button>
                </StackPanel>
            </Grid>

            <Border Grid.Row="15" BorderThickness="0,2,0,0" Grid.ColumnSpan="2" BorderBrush="{DynamicResource HighlightBrush}" Margin="0,5,50,0">
                <Button Margin="10,9,10,10" Name="AdvancedSettingsButton" Style="{StaticResource LinkButton}" Click="AdvancedSettingsButtonClick">Show advanced settings...</Button>
            </Border>
        </Grid>
    </ScrollViewer>
</UserControl>
